package
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	public class shoppingbag extends Sprite
	{
		public function shoppingbag()
		{
			super();
			
			addEventListener(Event.ADDED_TO_STAGE, ADDED_TO_STAGE);
		}
		
		private function ADDED_TO_STAGE($e:Event):void {
			var s:Sprite;
			s = new Sprite;
			var g:Sprite;
			g = new Sprite;
			s.addEventListener(MouseEvent.MOUSE_DOWN, function($e:MouseEvent):void { startDrag(); });
			s.addEventListener(MouseEvent.MOUSE_UP, function($e:MouseEvent):void { stopDrag(); });
			
			s.graphics.clear();
			s.graphics.beginFill(0xff0000);
			s.graphics.drawRect(0,0,300,400);
			s.graphics.endFill();
			g.graphics.clear();
			g.graphics.beginFill(0xffff00);
			g.graphics.drawRect(20,20,200,300);
			g.graphics.endFill();
			
			addChild(s);
			addChild(g);
		}
	}
}